Example 4 - Add rows and symbols using a counter

 

This example starts Milestones Professional, creates a new file, and then places text into seven task lines, one per row, and then adds seven symbols using a counter for the month. Note that this program assumes that month is the first position of the sort date format.

 

Public Sub Example4()

        Dim objmilestones As Object

        Dim strtemp As String

        objMilestones = CreateObject("Milestones")

        With objMilestones

            .Activate()

            .use20columns()

            For ncounter = 1 To 20

                .setcolumnproperty(ncounter, "width", 0)

                .setcolumnproperty(ncounter, "SmartColumn ", "none")

            Next

            .setcolumnproperty(10, "width", 1)  'Task Column

            For nCounter = 1 To 7

                strTemp = "This is Task Row " + CStr(nCounter)

                .PutCell(nCounter, 10, strtemp)

                strtemp = CStr(nCounter + 1) + "/1/2022"

                .AddSymbol(nCounter, strTemp, nCounter)

            Next nCounter

            .setstartandenddates("1/1/2022", "8/31/2022")

            .Refresh()

            .KeepScheduleOpen()

        End With

        Exit Sub

        End

    End Sub

 

 

    

Running this program will produce a chart similar to the one below:

 

Related Topics

  1. Example 2 - Open and print an existing schedule
  2. Example 3 - Create and save under a new file name
  3. Example 13 - A Milestones automation sampler
  4. Example 14 - Outlined schedule with graph

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

To effectively program with this interface, it's important to learn all about Milestones Professional.  Learn about Milestones.

Milestones Professional 2025 Automation Methods and Properties.  © Copyright 2000-2025, KIDASA Software, Inc. All rights reserved.